<?php
$document = &JFactory::getDocument();
$css = JURI::base().'modules/mod_jv_twitter/assets/css/jv_twitter.css';
$urlAjax = JURI::base().'modules/mod_jv_twitter/request_ajax.php';
$homeTwitter = 'module'.$module->id.'_twitter_home';
$statusId = 'twitter_status'.$module->id;
$js = JURI::base().'modules/mod_jv_twitter/assets/js/jv_accordion.js';
$jsSplit = JURI::base().'modules/mod_jv_twitter/assets/js/jv_twitter.js';
$document->addScript($js);
$document->addScript($jsSplit);
$document->addStyleSheet($css);
$isAccord=0;
if($params->get('show_avatar_header') == 1 || $params->get('show_username_header') == 1) $isAccord = 1;
$strFollow = $params->get('usernames');
$aryUser = split(',',$strFollow);
?>
<script type="text/javascript">
var jvTwitter<?php echo $module->id; ?> = function() {
	var twitter = new JVTwitter('<?php echo $homeTwitter;?>',
			{
				urlAjax:'<?php echo $urlAjax;?>',
				moduleId:'<?php echo $module->id;?>',			
				wrapTwitter:'jv_wrap_twitter<?php echo $module->id; ?>',
				statusId:'<?php echo $statusId; ?>',
				isAccord:<?php echo $isAccord; ?>,
				isMerge:<?php echo $params->get('merge_twitter'); ?>												
			});	     
};
window.addEvent('domready',jvTwitter<?php echo $module->id; ?>);
</script>
<div style="display: none;"><a href="http://www.joomlavision.com" title="Joomla Templates">Joomla Templates</a> and Joomla Extensions by JoomlaVision.Com</div>
<div id="jv_twitter_follow<?php echo $module->id; ?>" class="twitter_follow">
	<?php foreach($aryUser as $item ) {?>
	<div class="jv_twit_follow">Follow&nbsp;<a href="http://twitter.com/<?php echo $item; ?>"><?php echo $item;?></a> on twitter</div>
	<?php } ?>
</div>
<div class="jv_wrap_twitter twitter-ajax-loading" id="jv_wrap_twitter<?php echo $module->id;?>">
</div>